//
//  LeftViewController.m
//  JobFreely
//
//  Created by Dale on 2017/5/23.
//  Copyright © 2017年 Dale. All rights reserved.
//

#import "LeftViewController.h"
#import "CenterViewController.h"
#import "UIViewController+MMDrawerController.h"

@interface LeftViewController ()

@property (weak, nonatomic) IBOutlet UIButton *headBtn;

@end

@implementation LeftViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = kBaseBGColor;
    setViewCorner(self.headBtn, 20);
}

- (IBAction)handleHeadBtnAction:(UIButton *)sender {
    //go setting
    [self transeferToMenuViewController:EMainMenuSetting];
}

- (IBAction)handleMainEntranceBtnAction:(UIButton *)sender {
    if (sender.tag == ESideScrumTag) {
        //go scrum
        [self transeferToMenuViewController:EMainMenuScrum];
    } else if (sender.tag == ESideFriendTag){
        //go frend
        [self transeferToMenuViewController:EMainMenuFriend];
    } else if (sender.tag == ESideFeedBackTag) {
        //go feedback
        [self transeferToMenuViewController:EMainMenuFeedBack];
    }
}



#pragma mark - Navigation
- (void)transeferToMenuViewController:(EMainMenu)menuIndex {
    CenterViewController *centerVC = (CenterViewController *)self.mm_drawerController.centerViewController;
    if (centerVC.curIndex != menuIndex) {
        [centerVC replaceControllerToIndex:menuIndex];
    }
    [self.mm_drawerController closeDrawerAnimated:YES completion:^(BOOL finished) {
    }];
}

@end
